﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Wpf.Ui.Controls;

namespace ClientAppraise.Controls
{
    public class ZxMessageBox
    {

        public  async Task<Wpf.Ui.Controls.MessageBoxResult> ConfirmAsync(string title) {
            return await ConfirmAsync(title, title);
        }
        public  async Task<Wpf.Ui.Controls.MessageBoxResult> ConfirmAsync(string title, string content) {
            var mb = new Wpf.Ui.Controls.MessageBox
            {
                Title = title,
                Content = content,
                WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner,
                PrimaryButtonText = "Yes",
                CloseButtonText = "No",
                MinHeight = 180,
                MinWidth = 260,
            };

            foreach (Window item in App.Current.Windows) {

                if (item.IsActive) {
                    mb.Owner = item;
                    break;
                }
            }

            return await mb.ShowDialogAsync();
            
        }

    }
}
